package tools;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import javax.swing.filechooser.FileSystemView;

public interface Constants {
    public static final String STEAM_FOLDER = "C:/Program Files (x86)/Steam/steamapps";
    
    public static final String DATABASES_SOURCE = "C:\\Users\\xiaoxiao\\AppData\\Local\\Firaxis Games\\Sid Meier's Civilization VI\\Cache";
    public static final String DATABASES = "jdbc:sqlite:database";
    public static final String GAMEPLAY_DATABASE = DATABASES + "/" + "DebugGameplay.sqlite";
    public static final String EXTRA_DATABASE = DATABASES + "/" + "extra.sqlite";
    public static final String TEXT_DATABASE = DATABASES + "/" + "DebugLocalization.sqlite";
    public static final String NOHD_TEXT_DATABASE = DATABASES + "/" + "nohd_DebugLocalization.sqlite";
    
    public static final String PLAYER_COLORS = STEAM_FOLDER + "/" + "common/Sid Meier's Civilization VI/Base/Assets/UI/Colors";
    public static final String EXTRA_SCH = "extra.sql";
    public static final List<String> DDS_FOLDERS = getDDSFolders();

    public static final String XLS = "Texts.xlsx";
    
    public static List<String> getDDSFolders () {
        String[] base = new String[] {
            "C:/Program Files (x86)/Steam/steamapps/common/Sid Meier's Civilization VI SDK Assets/Civ6/pantry/Textures",
            "C:/Program Files (x86)/Steam/steamapps/common/Sid Meier's Civilization VI SDK Assets/Civ6/DLC/Expansion2/pantry/Textures",
            "C:/Program Files (x86)/Steam/steamapps/common/Sid Meier's Civilization VI SDK Assets/Civ6/DLC/Expansion1/pantry/Textures",
            "C:/Program Files (x86)/Steam/steamapps/common/Sid Meier's Civilization VI SDK Assets/Civ6/DLC/Shared/pantry/Textures",
            "C:/Program Files (x86)/Steam/steamapps/common/Sid Meier's Civilization VI SDK Assets/Civ6/DLC/CivRoyaleScenario/pantry/Textures", 

            // hd
            "C:/Users/xiaoxiao/Documents/My Games/Sid Meier's Civilization VI/Mods/civ6-harmony-in-diversity/Assets/CityStates",
            "C:/Users/xiaoxiao/Documents/My Games/Sid Meier's Civilization VI/Mods/civ6-harmony-in-diversity/Assets/Buildings", 
            "C:/Users/xiaoxiao/Documents/My Games/Sid Meier's Civilization VI/Mods/civ6-harmony-in-diversity/Assets/CityStates", 
            "C:/Users/xiaoxiao/Documents/My Games/Sid Meier's Civilization VI/Mods/civ6-harmony-in-diversity/Assets/GreatPeople",
            "C:/Users/xiaoxiao/Documents/My Games/Sid Meier's Civilization VI/Mods/civ6-harmony-in-diversity/Assets/Projects", 
            "C:/Users/xiaoxiao/Documents/My Games/Sid Meier's Civilization VI/Mods/civ6-harmony-in-diversity/Assets/UnitActions", 
            "C:/Users/xiaoxiao/Documents/My Games/Sid Meier's Civilization VI/Mods/civ6-harmony-in-diversity/Assets/Units/MedivalPirate",
            "C:/Users/xiaoxiao/Documents/My Games/Sid Meier's Civilization VI/Mods/civ6-harmony-in-diversity/Assets/Resourceful2", 
            "C:/Users/xiaoxiao/Documents/My Games/Sid Meier's Civilization VI/Mods/civ6-harmony-in-diversity/Assets/TechCivics", 
            "C:/Users/xiaoxiao/Documents/My Games/Sid Meier's Civilization VI/Mods/district-expansion-hdAssets", 

            // real great people
            "C:/Program Files (x86)/Steam/steamapps/workshop/content/289070/2383232087/Icons/Admiral", 
            "C:/Program Files (x86)/Steam/steamapps/workshop/content/289070/2383232087/Icons/Artist", 
            "C:/Program Files (x86)/Steam/steamapps/workshop/content/289070/2383232087/Icons/Engineer", 
            "C:/Program Files (x86)/Steam/steamapps/workshop/content/289070/2383232087/Icons/General", 
            "C:/Program Files (x86)/Steam/steamapps/workshop/content/289070/2383232087/Icons/Merchant", 
            "C:/Program Files (x86)/Steam/steamapps/workshop/content/289070/2383232087/Icons/Musician", 
            "C:/Program Files (x86)/Steam/steamapps/workshop/content/289070/2383232087/Icons/Prophet", 
            "C:/Program Files (x86)/Steam/steamapps/workshop/content/289070/2383232087/Icons/Scientist", 
            "C:/Program Files (x86)/Steam/steamapps/workshop/content/289070/2383232087/Icons/Writer"
        };
        List<String> folders = new ArrayList<>();
        for (String folder : base) {
            folders.add(folder);
        }
        File mod = new File(Tools.STEAM_FOLDER + "/workshop/content/289070");
        for (File sub : mod.listFiles()) {
            File dds1 = new File(sub, "Textures");
            if (dds1.exists() && dds1.isDirectory()) {
                folders.add(dds1.getAbsolutePath());
            }
            File dds2 = new File(sub, "Icons");
            if (dds2.exists() && dds2.isDirectory()) {
                folders.add(dds2.getAbsolutePath());
            }
        }
        return folders;
    }

    public static final String IMAGE_URL = "../../../icons";
    public static final String LINK_URL = "../../..";

    public static final String STYLES = "\t\t<style>\n\t\t\timg{vertical-align: text-bottom;}\n\t\t\t.index{width: auto; float: left; margin: 1% 1% 1% 1%; padding: 0% 1% 0% 1%; background-color: whitesmoke; box-shadow: 5px 5px 5px whitesmoke; font-size: large; line-height:27px;}\n\t\t\t.main{width: 600px; position: absolute; left:50%; margin: 1% 0px 1% -300px; padding: 0% 1% 0% 1%; background-color: whitesmoke; box-shadow: 5px 5px 5px whitesmoke; font-size: large;}\n\t\t</style>\n";
}
